package org.idea.spring.ioc.jndi.interfaces.impl;

import javax.naming.Context;
import javax.naming.Name;
import javax.naming.Reference;
import javax.naming.spi.ObjectFactory;
import java.util.Hashtable;

/**
 * @Author idea
 * @Date created in 3:21 下午 2020/4/19
 */
public class SimpleLogServiceFactory implements ObjectFactory {

    @Override
    public Object getObjectInstance(Object obj, Name name, Context ctx,
                                    Hashtable<?, ?> env) {
        if (obj instanceof Reference) {
            return new SimpleLogService();
        }
        return null;
    }
}
